/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package me.send.data.service.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import me.send.business.base.Pager;
import me.send.data.service.mapper.VersionMapper;
import me.send.data.service.pojo.Version;
import me.send.data.service.pojo.VersionBean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author maxmin
 *
 * @date 2015年9月25日 下午4:09:20
 */
@Service
public class VersionService {
	
	@Autowired
	VersionMapper versionMapper;
	
	public Version getVersionByType(int type){
		return versionMapper.getVersionByType(type);
	}
	
	public List<VersionBean> list(Integer type,Pager page){
		Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("type", type);
    	parameter.put("page", page);
		return versionMapper.list(parameter);
	}
	public Integer count(Integer type){
		Map<String, Object> parameter = new HashMap<String, Object>();
		parameter.put("type", type);
		return versionMapper.count(parameter);
	}
	
	public VersionBean queryVersionById(int version_id){
		return versionMapper.getVersionById(version_id);
	}
	
	public void update(VersionBean version){
		versionMapper.update(version);
	}
}
